<% @title = t('.title') %>

<% if @ownerships.any? %>
  <div class="t-body">
    <%= form_tag notifier_path, method: :put do %>
      <p><%= t('.info') %></p>

      <% @ownerships.each do |ownership| %>
        <h2><%= ownership.rubygem.name %></h2>
        <h4 class="t-list__heading"><%= t('.push_heading') %></h3>
        <div class="push--s">
          <%= label_tag do %>
            <%= radio_button_tag "ownerships[#{ownership.id}][push]", :on, ownership.push_notifier? %>
            <%= t('.on') %> <em>(<%= t('.recommended') %>)</em>
          <% end %>
          <br>
          <%= label_tag do %>
            <%= radio_button_tag "ownerships[#{ownership.id}][push]", :off, !ownership.push_notifier? %>
            <%= t('.off') %>
          <% end %>
        </div>

        <h4 class="t-list__heading"><%= t('.owner_heading') %></h3>
        <div class="push--s">
          <%= label_tag do %>
            <%= radio_button_tag "ownerships[#{ownership.id}][owner]", :on, ownership.owner_notifier? %>
            <%= t('.on') %> <em>(<%= t('.recommended') %>)</em>
          <% end %>
          <br>
          <%= label_tag do %>
            <%= radio_button_tag "ownerships[#{ownership.id}][owner]", :off, !ownership.owner_notifier? %>
            <%= t('.off') %>
          <% end %>
        </p>
      <% end %>
      <%= submit_tag t('.update'), class: 'form__submit' %>
    <% end %>
  </div>
<% end %>
